#pragma once


// CProgressDlg dialog

#include "Problem/Problem.h"

class CProgressDlg : public CDialog
				   , public ProblemListener
{
	DECLARE_DYNAMIC(CProgressDlg)

public:
	CProgressDlg(Problem *pr, bool showMessage, CWnd* pParent = NULL);   // standard constructor
	virtual ~CProgressDlg();

// Dialog Data
	enum { IDD = IDD_PROGRESS_DIALOG };

	// Overloaded from ProblemListener
	virtual void onStepCompleated(gdScalar time, gdScalar totalTime, unsigned int numTimesteps);

	void solve(gdScalar time, const std::string& fileName);

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

private:

	void setProgress(gdScalar time, gdScalar totalTime, unsigned int numTimesteps);

public:
	virtual BOOL OnInitDialog();

private:

	Problem *m_problem;
	bool m_bShowMessage;

protected:
	virtual void OnOK();
	virtual void OnCancel();
public:
	afx_msg void OnTimer(UINT_PTR nIDEvent);

	ULONGLONG m_solvingStartTime;

};
